from django.conf import settings
from itsdangerous import TimedJSONWebSignatureSerializer as TIJS


def dump_(data_qq,time_qq):
    Tijs=TIJS(settings.SECRET_KEY,time_qq)
    secret_data=Tijs.dumps(data_qq)
    return secret_data.decode()

def load_(data_qq):
    Tijs=TIJS(settings.SECRET_KEY)
    try:
        secret_lod=Tijs.loads(data_qq)
    except:
        return None
    else:
        return secret_lod





